package adapters;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.example.administrator.newxlmedical.R;

import java.util.List;

import beans.HospitalRegisterDepartBean;
import beans.NewUserInfoBean;
import beans.UserInfoBean;
import butterknife.BindView;
import custom.BaseRecyclerAdapter;

/**
 * Created by Administrator on 2018/5/14.
 */

public class LogSearchUserAdapter extends BaseRecyclerAdapter<LogSearchUserAdapter.LogSUserAdapter> {
    private Context mContext;
    private LayoutInflater inflater;
    private List<UserInfoBean> list;

    public LogSearchUserAdapter(Context mContext, List<UserInfoBean> list) {
        this.mContext = mContext;
        this.list = list;
        inflater=LayoutInflater.from(mContext);
    }

    @Override
    public LogSUserAdapter onCreateViewHolder(ViewGroup parent, int viewType) {
        LogSUserAdapter viewHolder = new LogSUserAdapter(inflater.inflate(R.layout.adapter_hospital_register_depart, parent, false));
        return viewHolder;
    }

    @Override
    public void onBindViewHolder(LogSUserAdapter viewHolder, int position) {
        UserInfoBean bean = list.get(position);
        viewHolder.tvDepart.setText(bean.getName());

    }

    @Override
    public int getItemCount() {
        return list.size();
    }

    public class LogSUserAdapter extends BaseRecyclerAdapter.BaseViewHolder {
        @BindView(R.id.tv_adapter_hospital_depart)
        TextView tvDepart;

        public LogSUserAdapter(View itemView) {
            super(itemView);
        }
    }
}
